<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <include file="Public:head"/>
    <style>
        .login-container .loginbox {
            height: 280px !important;
            min-height: 280px;
        }
    </style>
</head>
<body>
<div class="login-container animated fadeInDown">
    <div class="loginbox bg-white">
        <div class="loginbox-title">管理后台</div>
        <div class="loginbox-social">
            <div class="social-title ">新华书店小书虫俱乐部</div>
        </div>
        <div class="loginbox-or">
            <div class="or-line"></div>
            <div class="or">登录</div>
        </div>
        <form method="post" action="{:U('handleLogin')}" onsubmit="return sm()">
            <div class="loginbox-textbox">
                <input type="text" name="account" class="form-control" placeholder="账号"/>
            </div>
            <div class="loginbox-textbox">
                <input type="password" name="password" class="form-control" placeholder="密码"/>
            </div>
            <div class="loginbox-submit">
                <button type="submit" class="btn btn-primary btn-block" id="handleLogin">登录</button>
            </div>
        </form>
    </div>
</div>
<include file="Public:js"/>
<script src="/admin/js/phpjs/strings/sha1.js"></script>
<script>
//    $(document).ready(function () {
//        $('#handleLogin').on('click', function () {
//            var password = $('form [name="password"]').val();
//            var account = $('form [name="account"]').val();
//            if (account == '') {
//
//            }
//            password = sha1(password);
//            $('form [name="password"]').val(password);
//
//            $('form').submit();
//        });
//    });
    function sm() {
        var password = $('form [name="password"]').val();
        var account = $('form [name="account"]').val();
        if (account == '') {
            alert("请填写用户名！");
            return false;
        }
        password = sha1(password);
        $('form [name="password"]').val(password);

        return true;
//        $('form').submit();
    }
</script>
</body>
</html>
